<%
	boolean logined = false;
	Cookie[] cookie = request.getCookies();
	String errorCode = "0";
	if(session.getAttribute("username") != null) {
		logined = true;
	}
	if(cookie != null) {
		for(int i = 0; i < cookie.length; i++) {
			if(cookie[i].getValue().equals(request.getParameter("username"))) {
				logined = true;
			}
		}
	}
	if(!logined) {
		errorCode = "4";
		response.sendRedirect("index.jsp?errorCode=" + errorCode);
		return;
	}
%>